<!--
 * @Description: 评估因子维护
 * @Author: wangwangwang
 * @Date: 2020-08-26 15:59:17
 * @LastEditors: wangwangwang
 * @LastEditTime: 2021-03-23 11:31:49
-->
<template>
  <div class="pages_content table">
    <el-container>
      <el-header>
        <breaDcrumb />
      </el-header>
      <div class="search" style="padding-bottom:0px;">
        <span>
          <span style="margin-right: 12px;">公司</span>
          <el-select v-model="tableParam.companyId" placeholder="请选择" @change="init()">
            <el-option v-for="item in companylist" :key="item.id" :label="item.name" :value="item.id"></el-option>
          </el-select>
        </span>
        <span>
          <el-button v-if="ButtonList.findIndex(res=>(res.buttonValue=='SHEZHIQUANZHONG'))!==-1" size="mini" class="bottom_all" @click="look1Fun()">设置权重</el-button>
        </span>
      </div>
      <el-main class="factorConent">
        <div>
          <div>
            <h4>工程基本信息：{{data[0].preFactors.factorsWeight}}%</h4>
            <el-button v-if="ButtonList.findIndex(res=>(res.buttonValue=='BIANJI'))!==-1" size="mini" class="bottom_all" @click="init('工程基本信息',data[0].preFactors.factorsWeight,true)">编辑</el-button>
          </div>
          <div>
            <el-row v-for="(v,k) in data[0].preFactors.factorsList" :key="k" class="listBox">
              <table>
                <span>{{v.factorsName}}：</span>
              </table>
              <div>
                <div v-if="k == 0 || k == 1">
                  <div v-for="(v2,k2) in v.factorListDetail" :key="k2">
                    <div v-show="v2.factorsType == 1" class="box1">
                      <table>小于{{v2.factorsValueTwo}}<span v-if="k==0">千米</span><span v-if="k==1">立方米</span>：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                    <div v-show="v2.factorsType == 2" class="box2 box3">
                      <table>{{v2.factorsValueOne}}至{{v2.factorsValueTwo}}<span v-if="k==0">千米</span><span v-if="k==1">立方米</span>：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                    <div v-show="v2.factorsType == 3" class="box1">
                      <table>大于{{v2.factorsValueOne}}<span v-if="k==0">千米</span><span v-if="k==1">立方米</span>：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                  </div>
                </div>
                <div v-if="k == 2">
                  <div v-for="(v2,k2) in v.factorListDetail" :key="k2">
                    <div class="box1">
                      <table v-for="(v3,k3) in typeIdList" v-show="v2.factorsType == v3.id" :key="k3">{{v3.itemName}}：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                  </div>
                </div>
                <div v-if="k == 3">
                  <div v-for="(v2,k2) in v.factorListDetail" :key="k2">
                    <div class="box1">
                      <table v-for="(v3,k3) in sourcesOfFundingList" v-show="v2.factorsType == v3.id" :key="k3">{{v3.itemName}}：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </el-row>
          </div>
        </div>

        <div>
          <div>
            <h4>施工单位情况：{{data[1].preFactors.factorsWeight}}%</h4>
            <el-button v-if="ButtonList.findIndex(res=>(res.buttonValue=='BIANJI'))!==-1" size="mini" class="bottom_all" @click="init('施工单位情况',data[1].preFactors.factorsWeight,true)">编辑</el-button>
          </div>
          <div>
            <el-row v-for="(v,k) in data[1].preFactors.factorsList" :key="k" class="listBox">
              <table>
                <span>{{v.factorsName}}：</span>
              </table>
              <div>
                <div v-if="k == 0 || k == 1">
                  <div v-for="(v2,k2) in v.factorListDetail" :key="k2">
                    <div v-show="v2.factorsType == 1" class="box1">
                      <table>小于{{v2.factorsValueTwo}}<span v-if="k==0">年</span><span v-if="k==1">万</span>：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                    <div v-show="v2.factorsType == 2" class="box2 box3">
                      <table>{{v2.factorsValueOne}}至{{v2.factorsValueTwo}}<span v-if="k==0">年</span><span v-if="k==1">万</span>：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                    <div v-show="v2.factorsType == 3" class="box1">
                      <table>大于{{v2.factorsValueOne}}<span v-if="k==0">年</span><span v-if="k==1">万</span>：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                  </div>
                </div>
                <div v-if="k == 2 ">
                  <div v-for="(v2,k2) in v.factorListDetail" :key="k2">
                    <div v-show="k2==0" class="box1">
                      <table>有抵押：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                    <div v-show="k2==1" class="box1">
                      <table>无抵押：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                  </div>
                </div>
                <div v-if="k == 3 ">
                  <div v-for="(v2,k2) in v.factorListDetail" :key="k2">
                    <div v-show="k2==0" class="box1">
                      <table>有涉诉：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                    <div v-show="k2==1" class="box1">
                      <table>无涉诉：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                  </div>
                </div>
                <div v-if="k == 4 ">
                  <div v-for="(v2,k2) in v.factorListDetail" :key="k2">
                    <div v-show="k2==0" class="box1">
                      <table>有合作：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                    <div v-show="k2==1" class="box1">
                      <table>无合作：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </el-row>
          </div>
        </div>

        <div>
          <div>
            <h4>建设单位情况：{{data[2].preFactors.factorsWeight}}%</h4>
            <el-button v-if="ButtonList.findIndex(res=>(res.buttonValue=='BIANJI'))!==-1" size="mini" class="bottom_all" @click="init('建设单位情况',data[2].preFactors.factorsWeight,true)">编辑</el-button>
          </div>
          <div>
            <el-row v-for="(v,k) in data[2].preFactors.factorsList" :key="k" class="listBox">
              <table>
                <span>{{v.factorsName}}：</span>
              </table>
              <div>
                <div v-if="k == 0 || k == 1">
                  <div v-for="(v2,k2) in v.factorListDetail" :key="k2">
                    <div v-show="v2.factorsType == 1" class="box1">
                      <table>小于{{v2.factorsValueTwo}}<span v-if="k==0">年</span><span v-if="k==1">万</span>：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                    <div v-show="v2.factorsType == 2" class="box2 box3">
                      <table>{{v2.factorsValueOne}}至{{v2.factorsValueTwo}}<span v-if="k==0">年</span><span v-if="k==1">万</span>：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                    <div v-show="v2.factorsType == 3" class="box1">
                      <table>大于{{v2.factorsValueOne}}<span v-if="k==0">年</span><span v-if="k==1">万</span>：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                  </div>
                </div>
                <div v-if="k == 2 ">
                  <div v-for="(v2,k2) in v.factorListDetail" :key="k2">
                    <div v-show="k2==0" class="box1">
                      <table>有抵押：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                    <div v-show="k2==1" class="box1">
                      <table>无抵押：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                  </div>
                </div>
                <div v-if="k == 3 ">
                  <div v-for="(v2,k2) in v.factorListDetail" :key="k2">
                    <div v-show="k2==0" class="box1">
                      <table>有涉诉：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                    <div v-show="k2==1" class="box1">
                      <table>无涉诉：</table>
                      <div>
                        <el-input-number v-model="v2.factorsScore" disabled size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                        <span>分</span>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </el-row>
          </div>
        </div>
      </el-main>
    </el-container>
    <!-- 工程基本信息,施工单位情况 -->
    <el-dialog v-dialogDrag :visible.sync="getFactorsPreListType" width="800px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">{{ formEngineering.factorsName}}</span>
      <div v-if="UserInfo.adminStatus ==1" style="padding-left:20px;">
        <span slot="label">所属单位：</span>
        <el-select v-model="tableParam.companyId" placeholder="请选择">
          <el-option v-for="item in companylist" :key="item.id" :label="item.name" :value="item.id"></el-option>
        </el-select>
      </div>
      <div class="dialoginfo FZYform">
        <table>
          <b>权重：</b>
          <span>{{formEngineering.factorsWeight}}</span>
          <span>%</span>
        </table>
        <div v-for="(v,k) in formEngineering.factorsList" :key="k">
          <b>{{v.factorsName}}：</b>
          <div v-if="k == 0 || k == 1">
            <div v-for="(v2,k2) in v.factorListDetailCP" :key="k2">
              <div v-if="k2 == 0" class="liBox1">
                <div>
                  <span>小于</span>
                  <el-input-number v-model="v2.factorsValueTwo" size="mini" :controls="false" :precision="0" @blur="inpuSizeCheck(v2,k2,v.factorListDetailCP)" @change="v.factorListDetailCP[k2+1].factorsValueOne = v2.factorsValueTwo"></el-input-number>
                </div>
                <div>
                  <span v-if="k == 0">千米</span>
                  <span v-else>立方米</span>
                  <b>：</b>
                  <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                  <span>分数</span>
                </div>
              </div>
              <div v-else-if="k2>0 && k2 < v.factorListDetailCP.length-1 && v2.type !=0" class="liBox3" :style="v2.type == 0 ? 'border-bottom:0px;':'clor:red;'">
                <div>
                  <div>
                    <el-input-number v-model="v.factorListDetailCP[k2-1].factorsValueTwo" size="mini" :controls="false" :precision="0" disabled></el-input-number>
                    <span>至</span>
                    <el-input-number v-model="v2.factorsValueTwo" size="mini" :controls="false" :precision="0" @blur="inpuSizeCheck(v2,k2,v.factorListDetailCP)" @change="v.factorListDetailCP[k2+1].factorsValueOne = v2.factorsValueTwo"></el-input-number>
                  </div>
                  <div>
                    <span v-if="k == 0">千米</span>
                    <span v-else>立方米</span>
                    <b>：</b>
                    <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                    <span>分数</span>
                  </div>
                </div>
                <div>
                  <el-button v-if="v.factorListDetailCP.length-2 == k2" type="text" @click="addJson(k,k2)">添加区间</el-button>
                  <el-button v-else type="text" @click="delJson(k,k2)">删除区间</el-button>
                </div>
              </div>
              <div v-else-if="k2 == v.factorListDetailCP.length-1 " class="liBox2">
                <div>
                  <span>大于</span>
                  <el-input-number v-model="v.factorListDetailCP[v.factorListDetailCP.length-2].factorsValueTwo" size="mini" :controls="false" :precision="0" disabled></el-input-number>
                </div>
                <div>
                  <span v-if="k == 0">千米</span>
                  <span v-else>立方米</span>
                  <b>：</b>
                  <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                  <span>分数</span>
                </div>
              </div>
            </div>
          </div>
          <div v-else-if="k == 2">
            <div v-for="(v2,k2) in v.factorListDetail" :key="k2">
              <div v-show="v2.type != 0" class="liBox1 liBox4">
                <div>
                  <el-select v-model="v2.factorsType" size="mini" placeholder="请选择" @change="factorsTypeFun(v2,k2,v.factorListDetail)">
                    <el-option v-for="(item, index) in typeIdList" :key="index" :label="item.itemName" :value="item.id"></el-option>
                  </el-select>
                  <b>：</b>
                  <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                  <span>分数</span>
                </div>
                <div>
                  <el-button v-if="v.factorListDetail.length-1 == k2" type="text" @click="addJson('工程性质')">添加</el-button>
                  <el-button v-else type="text" @click="delJson('工程性质',k2)">删除</el-button>
                </div>
              </div>
            </div>
          </div>
          <div v-if="k==3">
            <div v-for="(v2,k2) in v.factorListDetail" :key="k2">
              <div v-show="v2.type != 0" class="liBox1 liBox4">
                <div>
                  <el-select v-model="v2.factorsType" size="mini" disabled>
                    <el-option v-for="(item, index) in sourcesOfFundingList" :key="index" :label="item.itemName" :value="item.id"></el-option>
                  </el-select>
                  <b>：</b>
                  <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                  <span>分数</span>
                </div>
                <div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="getFactorsPreListType=false">取 消</el-button>
        <el-button class="bottom_all" style="margin-left: 24px;" @click="saveOrUpdatePostFun()">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 建设单位情况 -->
    <el-dialog v-dialogDrag :visible.sync="formType2" width="800px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">{{ formEngineering.factorsName}}</span>
      <div v-show="UserInfo.adminStatus == 1" style="padding-left:20px;">
        <span slot="label">所属单位：</span>
        <el-select v-model="tableParam.companyId" placeholder="请选择">
          <el-option v-for="item in companylist" :key="item.id" :label="item.name" :value="item.id"></el-option>
        </el-select>
      </div>
      <div class="dialoginfo FZYform">
        <table>
          <b>权重：</b>
          <span>{{formEngineering.factorsWeight}}</span>
          <span>%</span>
        </table>
        <div v-for="(v,k) in formEngineering.factorsList" :key="k">
          <b>{{v.factorsName}}：</b>
          <div v-if="k == 0 || k == 1">
            <div v-for="(v2,k2) in v.factorListDetailCP" :key="k2">
              <div v-if="k2 == 0" class="liBox1">
                <div>
                  <span>小于</span>
                  <el-input-number v-model="v2.factorsValueTwo" size="mini" :controls="false" @blur="inpuSizeCheck(v2,k2,v.factorListDetailCP)" @change="v.factorListDetailCP[k2+1].factorsValueOne = v2.factorsValueTwo"></el-input-number>
                </div>
                <div>
                  <span v-if="k == 0">年</span>
                  <span v-else>万</span>
                  <b>：</b>
                  <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                  <span>分数</span>
                </div>
              </div>
              <div v-else-if="k2>0 && k2 < v.factorListDetailCP.length-1 && v2.type !=0" class="liBox3" :style="v2.type == 0 ? 'border-bottom:0px;':'clor:red;'">
                <div>
                  <div>
                    <el-input-number v-model="v.factorListDetailCP[k2-1].factorsValueTwo" size="mini" :controls="false" disabled></el-input-number>
                    <span>至</span>
                    <el-input-number v-model="v2.factorsValueTwo" size="mini" :controls="false" @blur="inpuSizeCheck(v2,k2,v.factorListDetailCP)" @change="v.factorListDetailCP[k2+1].factorsValueOne = v2.factorsValueTwo"></el-input-number>
                  </div>
                  <div>
                    <span v-if="k == 0">年</span>
                    <span v-else>万</span>
                    <b>：</b>
                    <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                    <span>分数</span>
                  </div>
                </div>
                <div>
                  <el-button v-if="v.factorListDetailCP.length-2 == k2" type="text" @click="addJson(k,k2)">添加区间</el-button>
                  <el-button v-else type="text" @click="delJson(k,k2)">删除区间</el-button>
                </div>
              </div>
              <div v-else-if="k2 == v.factorListDetailCP.length-1 " class="liBox2">
                <div>
                  <span>大于</span>
                  <el-input-number v-model="v.factorListDetailCP[v.factorListDetailCP.length-2].factorsValueTwo" size="mini" :controls="false" disabled></el-input-number>
                </div>
                <div>
                  <span v-if="k == 0">年</span>
                  <span v-else>万</span>
                  <b>：</b>
                  <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                  <span>分数</span>
                </div>
              </div>
            </div>
          </div>
          <div v-if="k == 2" class="liBoxBox0">
            <div v-for="(v2,k2) in v.factorListDetail" :key="k2" class="liBoxBox1">
              <div class="liBox1 liBox5">
                <div v-show="k2 == 0">
                  <span>有抵押：</span>
                  <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                  <span>分数</span>
                </div>
                <div v-show="k2 == 1">
                  <span>无抵押：</span>
                  <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                  <span>分数</span>
                </div>
              </div>
            </div>
          </div>
          <div v-if="k == 3" class="liBoxBox0">
            <div v-for="(v2,k2) in v.factorListDetail" :key="k2" class="liBoxBox1">
              <div class="liBox1 liBox5">
                <div v-show="k2 == 0">
                  <span>有抵押：</span>
                  <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                  <span>分数</span>
                </div>
                <div v-show="k2 == 1">
                  <span>无抵押：</span>
                  <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                  <span>分数</span>
                </div>
              </div>
            </div>
          </div>
          <div v-if="k == 4" class="liBoxBox0">
            <div v-for="(v2,k2) in v.factorListDetail" :key="k2" class="liBoxBox1">
              <div class="liBox1 liBox5">
                <div v-show="k2 == 0">
                  <span>有合作：</span>
                  <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                  <span>分数</span>
                </div>
                <div v-show="k2 == 1">
                  <span>无合作：</span>
                  <el-input-number v-model="v2.factorsScore" size="mini" :controls="false" :min="0" :max="10"></el-input-number>
                  <span>分数</span>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="formType2=false">取 消</el-button>
        <el-button class="bottom_all" style="margin-left: 24px;" @click="saveOrUpdatePostFun()">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 设置权重 -->
    <el-dialog v-dialogDrag :visible.sync="look1Type" width="500px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">设置权重</span>
      <div class="amap-page-container">
        <el-form ref="formDate" :inline="true" :model="formDate" label-width="110px">
          <el-form-item prop="factorsWeightOne" label-width="120px" label="工程基本信息" :rules="[{required: true,message: '请输入工程基本信息权重',trigger: 'blur',}]">
            <el-input v-model="formDate.factorsWeightOne" type="Number">
              <template slot="append">%</template>
            </el-input>
          </el-form-item>
          <el-form-item prop="factorsWeightTwo" label-width="120px" label="施工单位情况" :rules="[{required: true,message: '请输入施工单位情况权重',trigger: 'blur',}]">
            <el-input v-model="formDate.factorsWeightTwo" type="Number">
              <template slot="append">%</template>
            </el-input>
          </el-form-item>
          <el-form-item prop="factorsWeightThree" label-width="120px" label="建设单位情况" :rules="[{required: true,message: '请输入建设单位情况权重',trigger: 'blur',}]">
            <el-input v-model="formDate.factorsWeightThree" type="Number">
              <template slot="append">%</template>
            </el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="look1Type = false">取 消</el-button>
        <el-button class="bottom_all" style="margin-left: 24px" @click="savepoint()">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import mixin from "@/mixins/ICPSmixin.js";
import {
  getFactorsPreList,
  saveOrUpdatePost,
  queryFactorWeight,
  saveOrUpdateWeight
} from "@/api/basicConfig/factor.js";
import { getDicType, permissionsCompanyList } from "@/api/common.js";
import { getUserInfo } from "@/utils/auth.js";
export default {
  mixins: [mixin],
  data() {
    return {
      UserInfo: '',
      companylist: [],
      typeIdList: [],
      getFactorsPreListType: false,
      formType2: false,
      formType3: false,
      data: [{ preFactors: "" }, { preFactors: "" }, { preFactors: "" }],
      formEngineering: {},
      pagesType: 0,
      fromDate: {
        code: "",
      },
      listNumber: {},
      look1Type: false,
      formDate: {},
      sourcesOfFundingList: [
        { itemName: '财政预算投资', id: 1 },
        { itemName: '自筹资金投资', id: 2 },
        { itemName: '银行贷款投资', id: 3 },
        { itemName: '利用外资', id: 4 },
        { itemName: '利用有价证券', id: 5 },
      ],
    };
  },
  async created() {
    this.companylist = await permissionsCompanyList()
    this.tableParam.companyId = this.companylist[0].id
    this.UserInfo = await getUserInfo();
    getDicType({ code: "EngineeringNature" }).then((res) => {
      this.typeIdList = res.data.items;
    });
    this.init();
  },
  methods: {
    savepoint() {
      this.$refs.formDate.validate((valid) => {
        if (valid) {
          if ((Number(this.formDate.factorsWeightOne) + Number(this.formDate.factorsWeightTwo) + Number(this.formDate.factorsWeightThree)) == 100) {
            this.formDate.companyId = this.tableParam.companyId
            saveOrUpdateWeight(this.formDate).then((res) => {
              if (res.code == 1001) {
                this.look1Type = false
                this.init();
              }
            })
          } else {
            this.$message({
              message: '权重和不是100%。',
              type: 'warning'
            });
          }
        } else {
          return false;
        }
      });
    },
    look1Fun() {
      this.look1Type = true
      this.$refs.formDate.resetFields();
      queryFactorWeight({ companyId: this.tableParam.companyId }).then((res) => {
        if (res.data) {
          this.formDate = res.data
        }
      })
    },
    //组装初始化数据
    initJson(name) {
      this.formEngineering.factorsList[0].factorListDetailCP = [
        {
          factorsType: 1, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
          factorsValueOne: "0", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
          factorsValueTwo: "0", //3、区间 第二个值
          factorsScore: 0, //评估因子分数（0-10之前）
          factorsTopName: this.formEngineering.factorsList[0].factorsName, //上级评估因子参数
          factorsTopId: this.formEngineering.factorsList[0].id, //上级评估因子参数id
          type: 1, //数据处理方式：1新增，2修改0删除
        },
        {
          factorsType: 2, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
          factorsValueOne: "0", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
          factorsValueTwo: "0", //3、区间 第二个值
          factorsScore: 0, //评估因子分数（0-10之前）
          factorsTopName: this.formEngineering.factorsList[0].factorsName, //上级评估因子参数
          factorsTopId: this.formEngineering.factorsList[0].id, //上级评估因子参数id
          type: 1, //数据处理方式：1新增，2修改0删除
        },
        {
          factorsType: 3, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
          factorsValueOne: "0", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
          factorsValueTwo: 99999999, //3、区间 第二个值
          factorsScore: 0, //评估因子分数（0-10之前）
          factorsTopName: this.formEngineering.factorsList[0].factorsName, //上级评估因子参数
          factorsTopId: this.formEngineering.factorsList[0].id, //上级评估因子参数id
          type: 1, //数据处理方式：1新增，2修改0删除
        },
      ];
      this.formEngineering.factorsList[0].factorListDetail = []
      console.log(JSON.parse(JSON.stringify(this.formEngineering.factorsList[0].factorListDetailCP)))
      console.log(JSON.parse(JSON.stringify(this.formEngineering.factorsList[0].factorListDetail)))
      this.formEngineering.factorsList[1].factorListDetailCP = [
        {
          factorsType: 1, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
          factorsValueOne: "0", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
          factorsValueTwo: "0", //3、区间 第二个值
          factorsScore: 0, //评估因子分数（0-10之前）
          factorsTopName: this.formEngineering.factorsList[1].factorsName, //上级评估因子参数
          factorsTopId: this.formEngineering.factorsList[1].id, //上级评估因子参数id
          type: 1, //数据处理方式：1新增，2修改0删除
        },
        {
          factorsType: 2, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
          factorsValueOne: "0", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
          factorsValueTwo: "0", //3、区间 第二个值
          factorsScore: 0, //评估因子分数（0-10之前）
          factorsTopName: this.formEngineering.factorsList[1].factorsName, //上级评估因子参数
          factorsTopId: this.formEngineering.factorsList[1].id, //上级评估因子参数id
          type: 1, //数据处理方式：1新增，2修改0删除
        },
        {
          factorsType: 3, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
          factorsValueOne: "0", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
          factorsValueTwo: 99999999, //3、区间 第二个值
          factorsScore: 0, //评估因子分数（0-10之前）
          factorsTopName: this.formEngineering.factorsList[1].factorsName, //上级评估因子参数
          factorsTopId: this.formEngineering.factorsList[1].id, //上级评估因子参数id
          type: 1, //数据处理方式：1新增，2修改0删除
        },
      ];
      this.formEngineering.factorsList[1].factorListDetail = []
      let type1 = "";
      let type2 = "";
      if (name == "工程性质") {
        type1 = this.typeIdList[0].id;
        type2 = this.typeIdList[1].id;
      } else {
        type1 = 1;
        type2 = 2;
      }
      this.formEngineering.factorsList[2].factorListDetail = [
        {
          factorsType: type1, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
          factorsValueOne: "11", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
          factorsValueTwo: "12", //3、区间 第二个值
          factorsScore: 0, //评估因子分数（0-10之前）
          factorsTopName: this.formEngineering.factorsList[2].factorsName, //上级评估因子参数
          factorsTopId: this.formEngineering.factorsList[2].id, //上级评估因子参数id
          type: 1, //数据处理方式：1新增，2修改0删除
        },
        {
          factorsType: type2, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
          factorsValueOne: "11", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
          factorsValueTwo: "12", //3、区间 第二个值
          factorsScore: 0, //评估因子分数（0-10之前）
          factorsTopName: this.formEngineering.factorsList[2].factorsName, //上级评估因子参数
          factorsTopId: this.formEngineering.factorsList[2].id, //上级评估因子参数id
          type: 1, //数据处理方式：1新增，2修改0删除
        },
      ];
      if (name == "工程性质") {
        console.log(this.formEngineering.factorsList[3].factorListDetail);
        let dataFun = function (factorsType, factorsValueOne, factorsValueTwo, factorsScore, factorsTopName, factorsTopId, type) {
          return {
            factorsType: factorsType,
            factorsValueOne: factorsValueOne,
            factorsValueTwo: factorsValueTwo,
            factorsScore: factorsScore,
            factorsTopName: factorsTopName,
            factorsTopId: factorsTopId,
            type: type,
          }

        }
        this.formEngineering.factorsList[3].factorListDetail.push(dataFun(1, 0, 0, 0, this.formEngineering.factorsList[3].factorsName, this.formEngineering.factorsList[3].id, 1))
        this.formEngineering.factorsList[3].factorListDetail.push(dataFun(2, 0, 0, 0, this.formEngineering.factorsList[3].factorsName, this.formEngineering.factorsList[3].id, 1))
        this.formEngineering.factorsList[3].factorListDetail.push(dataFun(3, 0, 0, 0, this.formEngineering.factorsList[3].factorsName, this.formEngineering.factorsList[3].id, 1))
        this.formEngineering.factorsList[3].factorListDetail.push(dataFun(4, 0, 0, 0, this.formEngineering.factorsList[3].factorsName, this.formEngineering.factorsList[3].id, 1))
        this.formEngineering.factorsList[3].factorListDetail.push(dataFun(5, 0, 0, 0, this.formEngineering.factorsList[3].factorsName, this.formEngineering.factorsList[3].id, 1))
        console.log(JSON.parse(JSON.stringify(this.formEngineering.factorsList[3].factorListDetail)))
      } else {
        if (this.formEngineering.factorsList[3] != undefined) {
          this.formEngineering.factorsList[3].factorListDetail = [
            {
              factorsType: 1, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
              factorsValueOne: "11", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
              factorsValueTwo: "12", //3、区间 第二个值
              factorsScore: 0, //评估因子分数（0-10之前）
              factorsTopName: this.formEngineering.factorsList[3].factorsName, //上级评估因子参数
              factorsTopId: this.formEngineering.factorsList[3].id, //上级评估因子参数id
              type: 1, //数据处理方式：1新增，2修改0删除
            },
            {
              factorsType: 2, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
              factorsValueOne: "11", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
              factorsValueTwo: "12", //3、区间 第二个值
              factorsScore: 0, //评估因子分数（0-10之前）
              factorsTopName: this.formEngineering.factorsList[3].factorsName, //上级评估因子参数
              factorsTopId: this.formEngineering.factorsList[3].id, //上级评估因子参数id
              type: 1, //数据处理方式：1新增，2修改0删除
            },
          ];
        }
        if (this.formEngineering.factorsList[4] != undefined) {
          this.formEngineering.factorsList[4].factorListDetail = [
            {
              factorsType: 1, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
              factorsValueOne: "11", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
              factorsValueTwo: "12", //3、区间 第二个值
              factorsScore: 0, //评估因子分数（0-10之前）
              factorsTopName: this.formEngineering.factorsList[4].factorsName, //上级评估因子参数
              factorsTopId: this.formEngineering.factorsList[4].id, //上级评估因子参数id
              type: 1, //数据处理方式：1新增，2修改0删除
            },
            {
              factorsType: 2, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
              factorsValueOne: "11", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
              factorsValueTwo: "12", //3、区间 第二个值
              factorsScore: 0, //评估因子分数（0-10之前）
              factorsTopName: this.formEngineering.factorsList[4].factorsName, //上级评估因子参数
              factorsTopId: this.formEngineering.factorsList[4].id, //上级评估因子参数id
              type: 1, //数据处理方式：1新增，2修改0删除
            },
          ];
        }
      }
      console.log(this.formEngineering);
    },
    init(name, number, type) {
      if (type && !number) {
        this.$message({
          message: '请先设置权重！',
          type: 'warning'
        });
        return
      }
      // name = "施工单位情况";
      getFactorsPreList({ companyId: this.tableParam.companyId }).then((res) => {
        // console.log(JSON.parse(JSON.stringify(res.data)));
        if (name == "工程基本信息") {
          this.getFactorsPreListType = true
          //点了工程基本信息编辑
          console.log(res.data[0].preFactors.factorsList.length);
          this.formEngineering = res.data[0].preFactors;
          this.formEngineering.factorsList[0].factorListDetailCP = JSON.parse(JSON.stringify((this.formEngineering.factorsList[0].factorListDetail)))
          this.formEngineering.factorsList[1].factorListDetailCP = JSON.parse(JSON.stringify((this.formEngineering.factorsList[1].factorListDetail)))
          if (this.formEngineering.factorsList[0].factorListDetail.length == 0
          ) {
            //需要初始化数据
            this.initJson("工程性质");
          } else {
            this.formEngineering.factorsList[0].factorListDetail[this.formEngineering.factorsList[0].factorListDetail.length - 1].factorsValueTwo = 99999999
            this.formEngineering.factorsList[1].factorListDetail[this.formEngineering.factorsList[1].factorListDetail.length - 1].factorsValueTwo = 99999999
            this.formEngineering.factorsList[0].factorListDetailCP[this.formEngineering.factorsList[0].factorListDetailCP.length - 1].factorsValueTwo = 99999999
            this.formEngineering.factorsList[1].factorListDetailCP[this.formEngineering.factorsList[1].factorListDetailCP.length - 1].factorsValueTwo = 99999999
          }
        } else if (name == "施工单位情况") {
          this.formType2 = true,
            //点了施工单位编辑
            this.formEngineering = res.data[1].preFactors;
          this.formEngineering.factorsList[0].factorListDetailCP = JSON.parse(JSON.stringify((this.formEngineering.factorsList[0].factorListDetail)))
          this.formEngineering.factorsList[1].factorListDetailCP = JSON.parse(JSON.stringify((this.formEngineering.factorsList[1].factorListDetail)))
          if (this.formEngineering.factorsList[0].factorListDetail.length == 0
          ) {
            //需要初始化数据
            this.initJson();
          } else {
            this.formEngineering.factorsList[0].factorListDetail[this.formEngineering.factorsList[0].factorListDetail.length - 1].factorsValueTwo = 99999999
            this.formEngineering.factorsList[1].factorListDetail[this.formEngineering.factorsList[1].factorListDetail.length - 1].factorsValueTwo = 99999999
            this.formEngineering.factorsList[0].factorListDetailCP[this.formEngineering.factorsList[0].factorListDetailCP.length - 1].factorsValueTwo = 99999999
            this.formEngineering.factorsList[1].factorListDetailCP[this.formEngineering.factorsList[1].factorListDetailCP.length - 1].factorsValueTwo = 99999999
          }
        } else if (name == "建设单位情况") {
          this.formType2 = true
          //点了建设单位编辑
          this.formEngineering = res.data[2].preFactors;
          this.formEngineering.factorsList[0].factorListDetailCP = JSON.parse(JSON.stringify((this.formEngineering.factorsList[0].factorListDetail)))
          this.formEngineering.factorsList[1].factorListDetailCP = JSON.parse(JSON.stringify((this.formEngineering.factorsList[1].factorListDetail)))
          if (this.formEngineering.factorsList[0].factorListDetail.length == 0
          ) {
            //需要初始化数据
            this.initJson();
          } else {
            this.formEngineering.factorsList[0].factorListDetail[this.formEngineering.factorsList[0].factorListDetail.length - 1].factorsValueTwo = 99999999
            this.formEngineering.factorsList[1].factorListDetail[this.formEngineering.factorsList[1].factorListDetail.length - 1].factorsValueTwo = 99999999
            this.formEngineering.factorsList[0].factorListDetailCP[this.formEngineering.factorsList[0].factorListDetailCP.length - 1].factorsValueTwo = 99999999
            this.formEngineering.factorsList[1].factorListDetailCP[this.formEngineering.factorsList[1].factorListDetailCP.length - 1].factorsValueTwo = 99999999
          }
        } else {
          this.data = res.data;
        }
      });
    },
    //添加区间、添加工程性质
    addJson(name, k2) {
      if (name == 0) {
        let factorsValueOne = this.formEngineering.factorsList[0].factorListDetailCP[k2].factorsValueTwo
        let json = {
          factorsType: 2, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
          factorsValueOne: factorsValueOne, //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
          factorsValueTwo: 0, //3、区间 第二个值
          factorsScore: 0, //评估因子分数（0-10之前）
          factorsTopName: this.formEngineering.factorsList[0].factorsName, //上级评估因子参数
          factorsTopId: this.formEngineering.factorsList[0].id, //上级评估因子参数id
          type: 1, //数据处理方式：1新增，2修改0删除
        };
        let legth =
          this.formEngineering.factorsList[0].factorListDetailCP.length - 2;
        this.formEngineering.factorsList[0].factorListDetailCP.splice(
          legth,
          0,
          json
        );
      } else if (name == 1) {
        let factorsValueOne = this.formEngineering.factorsList[1].factorListDetailCP[k2].factorsValueTwo
        let json = {
          factorsType: 2, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
          factorsValueOne: factorsValueOne, //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
          factorsValueTwo: 0, //3、区间 第二个值
          factorsScore: 0, //评估因子分数（0-10之前）
          factorsTopName: this.formEngineering.factorsList[1].factorsName, //上级评估因子参数
          factorsTopId: this.formEngineering.factorsList[1].id, //上级评估因子参数id
          type: 1, //数据处理方式：1新增，2修改0删除
        };
        let legth =
          this.formEngineering.factorsList[1].factorListDetailCP.length - 2;
        this.formEngineering.factorsList[1].factorListDetailCP.splice(
          legth,
          0,
          json
        );
      } else if (name == "工程性质") {
        console.log("name=工程性质");
        let json = {
          factorsType: this.typeIdList[0].id, //评估因子类型(1、小于；2、大于；3、区间；4、选择值)
          factorsValueOne: "", //(1、小于；2、大于；4、选择值 对应的值 以及3、区间 第一个值)
          factorsValueTwo: "", //3、区间 第二个值
          factorsScore: 0, //评估因子分数（0-10之前）
          factorsTopName: this.formEngineering.factorsList[2].factorsName, //上级评估因子参数
          factorsTopId: this.formEngineering.factorsList[2].id, //上级评估因子参数id
          type: 1, //数据处理方式：1新增，2修改0删除
        };
        let legth = this.formEngineering.factorsList[2].factorListDetail.length;
        console.log(legth);
        this.formEngineering.factorsList[2].factorListDetail.splice(
          legth,
          0,
          json
        );
      }
      this.$forceUpdate()
    },
    //删除区间，删除工程性质
    delJson(name, k2) {
      console.log(name, k2);
      if (name == 0) {
        this.formEngineering.factorsList[0].factorListDetailCP.splice(k2, 1)
      } else if (name == 1) {
        this.formEngineering.factorsList[1].factorListDetailCP.splice(k2, 1)
      } else if (name == "工程性质") {
        this.formEngineering.factorsList[2].factorListDetail[k2].type = 0;
        console.log(this.formEngineering.factorsList[2].factorListDetail);
      }
      this.$forceUpdate()
    },
    //保存编辑的配置
    saveOrUpdatePostFun() {
      /**判断区间范围是否正确--开始 */
      let arr1 = this.formEngineering.factorsList[0].factorListDetailCP
      let arr2 = this.formEngineering.factorsList[1].factorListDetailCP
      let type1 = false, type2 = false
      arr1.forEach((v, k) => {
        if (v.factorsValueTwo == undefined) {
          type1 = true
        }
        if (k > 0 && v.factorsValueTwo - arr1[k - 1].factorsValueTwo <= 0) {
          type1 = true
        }
      })
      arr2.forEach((v, k) => {
        if (v.factorsValueTwo == undefined) {
          type2 = true
        }
        if (k > 0 && v.factorsValueTwo - arr2[k - 1].factorsValueTwo <= 0) {
          type2 = true
        }
      })
      console.log(JSON.parse(JSON.stringify(arr1)));
      console.log(JSON.parse(JSON.stringify(arr2)));
      console.log(type1, type2);
      /**判断区间范围是否正确--结束 */
      if (type1 || type2) {
        this.$message({
          message: '区间值范围不正确，请检查！',
          type: 'warning'
        });
      } else {
        console.log(JSON.parse(JSON.stringify(this.formEngineering)));
        //对比数据区间第一个--开始
        let update = this.formEngineering.factorsList[0].factorListDetailCP.filter((res) =>
          this.formEngineering.factorsList[0].factorListDetail.some((item) => res.id == item.id)
        );
        update.forEach((res) => {
          res.type = 2;//修改的
        });
        let deleteData = this.formEngineering.factorsList[0].factorListDetail.filter(
          (res) => !update.some((item) => res.id == item.id)
        );
        deleteData.forEach((res) => {
          res.type = 0; //0是删除
        });
        // let addData = this.formEngineering.factorsList[0].factorListDetailCP.filter(
        //   //新增的type默认写死为 1
        //   (res) => !update.some((item) => res.id == item.id)
        // );
        this.formEngineering.factorsList[0].factorListDetail = [...this.formEngineering.factorsList[0].factorListDetailCP, ...deleteData];
        //对比数据区间第二个--结束
        console.log(JSON.parse(JSON.stringify(this.formEngineering.factorsList[0].factorListDetail)))

        //对比数据区间第一个--开始
        let update2 = this.formEngineering.factorsList[1].factorListDetailCP.filter((res) =>
          this.formEngineering.factorsList[1].factorListDetail.some((item) => res.id == item.id)
        );
        update2.forEach((res) => {
          res.type = 2;//修改的
        });
        let deleteData2 = this.formEngineering.factorsList[1].factorListDetail.filter(
          (res) => !update2.some((item) => res.id == item.id)
        );
        deleteData.forEach((res) => {
          res.type = 0; //0是删除
        });
        // let addData2 = this.formEngineering.factorsList[1].factorListDetailCP.filter(
        //   //新增的type默认写死为 1
        //   (res) => !update2.some((item) => res.id == item.id)
        // );
        this.formEngineering.factorsList[1].factorListDetail = [...this.formEngineering.factorsList[1].factorListDetailCP, ...deleteData2];
        //对比数据区间第二个--结束
        console.log(JSON.parse(JSON.stringify(this.formEngineering.factorsList[1].factorListDetail)))

        let listArry = [];
        for (let i in this.formEngineering.factorsList) {
          for (let d in this.formEngineering.factorsList[i].factorListDetail) {
            listArry.push(
              this.formEngineering.factorsList[i].factorListDetail[d]
            );
          }
        }

        let company = this.companylist.filter((res) => {
          return res.id == this.tableParam.companyId
        }).name
        let json = [
          {
            id: this.formEngineering.id, //评估因子总类id
            factorsWeight: this.formEngineering.factorsWeight, //评估因子总类权重
            companyId: this.tableParam.companyId,
            company: company
          },
          listArry,
        ];
        console.log(JSON.parse(JSON.stringify(json)));
        saveOrUpdatePost(json).then(() => {
          this.getFactorsPreListType = false;
          this.formType2 = false;
          this.init();
        });
      }
    },
    /**区间填入值不能小于等于前一个大于等于后一个 */
    inpuSizeCheck(v2, k2, arr) {
      let frontNumber = '', afterNumber = '';
      let l = k2 - 1
      if (l < 0) {
        frontNumber = 0
      } else {
        for (l; l >= 0; l--) {
          frontNumber = arr[l].factorsValueTwo
          break
        }
      }
      let i = k2 + 1
      for (i; i < arr.length; i++) {
        console.log(i);
        console.log(arr[i]);
        afterNumber = arr[i].factorsValueTwo
        break
      }
      console.log(v2);
      console.log(frontNumber, afterNumber);
      if (v2.factorsValueTwo - frontNumber <= 0) {
        this.$message({
          message: '区间值范围不正确，请检查！',
          type: 'warning'
        });
      } else if (afterNumber - v2.factorsValueTwo <= 0) {
        this.$message({
          message: '区间值范围不正确，请检查！',
          type: 'warning'
        });
      }
      this.$forceUpdate()
    },
    factorsTypeFun(row, k2, arr) {
      arr.forEach((v, k) => {
        if (k2 != k && row.factorsType == v.factorsType) {
          this.$message({
            message: '工程性质重复！',
            type: 'warning'
          });
          row.factorsType = ''
          return
        }
      })
    }
  },
};
</script>

<style lang="scss" scoped>
.el-input,
.el-select {
  width: 240px;
}
.table_link {
  margin-left: 10px;
  color: $bg_color;
}

.table_link:hover {
  opacity: 0.8;
}
.factorConent {
  padding-top: 10px;
  padding-left: 50px;
  padding-right: 20px;
  padding-bottom: 20px;
  > div {
    padding-top: 20px;
    > div:nth-of-type(1) {
      h4 {
        display: inline-block;
      }
      button {
        float: right;
        margin-top: 10px;
      }
    }
    > div:nth-of-type(2) {
      margin-left: 20px;
      border-top: 1px solid #f2f2f2;
      border-left: 1px solid #f2f2f2;
      border-right: 1px solid #f2f2f2;
      .listBox {
        display: flex;
        padding-top: 5px;
        border-bottom: 1px solid #f2f2f2;
        > table {
          flex: 2;
          text-align: right;
          position: relative;
          line-height: 26px;
          font-weight: 600;
        }
        > div {
          flex: 22;
          > div {
            display: flex;
            flex-wrap: wrap;
            .box1,
            .box2,
            .box4 {
              padding-bottom: 5px;
              margin-left: 50px;
              width: 280px;
              display: flex;
              position: relative;
              .el-input-number::v-deep {
                display: inline-block;
                margin: 0px 10px;
                width: 110px;
              }
              > table {
                width: 160px;
                flex: none;
                line-height: 26px;
                text-align: right;
                color: #666;
                font-size: 13px;
              }
              > div {
                width: 110px;
                flex: none;
                position: relative;
                input {
                  width: 100%;
                  min-width: 30px;
                }
                > span {
                  line-height: 26px;
                  width: 0px;
                  position: absolute;
                  right: 10px;
                  top: 2px;
                  color: #666;
                }
              }
            }
            .box4 {
              //临时的样式，到时候这里不会是选项，同样是普通文本
              width: 280px;
              line-height: 28px;
              position: relative;
              b {
                padding-left: 15px;
              }
              .el-select {
                width: 150px;
              }
              .el-input-number::v-deep {
                display: inline-block;
                margin: 0px 10px;
                width: 90px;
              }
              > span {
                line-height: 26px;
                width: 0px;
                position: absolute;
                right: 20px;
                top: 2px;
                color: #666;
              }
            }
          }
        }
      }
    }
  }
}
.FZYform {
  line-height: 28px;
  > table {
    color: #00a754;
    display: flex;
    .el-input-number ::v-deep {
      margin: 0px 10px;
      width: 100px;
      input {
        color: #00a754;
        border-color: #00a754;
      }
    }
  }
  > div {
    margin-top: 20px;
    padding-left: 20px;
    > div {
      // background: #d7d7d7;
      border-top: 1px solid #f2f2f2;
      border-left: 1px solid #f2f2f2;
      border-right: 1px solid #f2f2f2;
      > div {
        display: flex;
        .liBox1,
        .liBox2 {
          border-bottom: 1px solid #f2f2f2;
          padding: 10px;
          width: 100%;
          display: flex;
          > div:nth-of-type(1) {
            width: 210px;
          }
          > div:nth-of-type(2) {
            flex: 1;
          }
          span {
            display: inline-block;
            margin-left: 20px;
          }
          .el-input-number ::v-deep {
            margin-left: 20px;
          }
        }
        .liBox3 {
          border-bottom: 1px solid #f2f2f2;
          padding: 10px;
          width: 100%;
          display: flex;
          > div:nth-of-type(1) {
            display: flex;
            > div:nth-of-type(1) {
              width: 210px;
              span {
                margin-left: 10px;
              }
              .el-input-number ::v-deep {
                margin-left: 10px;
                width: 80px;
              }
            }
            span {
              display: inline-block;
              margin-left: 20px;
            }
            .el-input-number ::v-deep {
              margin-left: 20px;
            }
          }
          > div:nth-of-type(2) {
            width: 130px;
            flex: none;
            line-height: 28px;
            padding-left: 20px;
          }
        }
        .liBox4 {
          width: 550px;
          > div:nth-of-type(1) {
            padding-left: 10px;
            width: 470px;
          }
          .el-select ::v-deep {
            margin-right: 25px;
            width: 220px;
          }
          > div:nth-of-type(2) {
            padding-left: 20px;
          }
        }
        .liBox5 {
          width: 280px;
          .el-input-number {
            width: 60px;
            margin-left: 10px;
          }
        }
      }
    }
    .liBoxBox0 {
      display: flex;
      .liBoxBox1 {
        width: 262px;
      }
    }
  }
}
</style>
